import request from '@/utils/request'

// 上传文档
export function uploadDocument(data) {
  return request({
    url: '/system/clean/upload',
    method: 'post',
    data: data
  })
}

// 获取清洗配置
export function getCleanConfig() {
  return request({
    url: '/system/clean/config',
    method: 'get'
  })
}

// 保存清洗配置
export function saveCleanConfig(data) {
  return request({
    url: '/system/clean/config',
    method: 'put',
    data: data
  })
}

// 开始清洗
export function startClean(data) {
  return request({
    url: '/system/clean/start',
    method: 'post',
    data: data
  })
}

// 导出清洗结果
export function exportCleanResult(query) {
  return request({
    url: '/system/clean/export',
    method: 'get',
    params: query
  })
}

// 获取黑词列表
export function getBlackWords() {
  return request({
    url: '/system/clean/blackwords',
    method: 'get'
  })
}

// 添加黑词
export function addBlackWord(data) {
  return request({
    url: '/system/clean/blackwords',
    method: 'post',
    data: data
  })
}

// 删除黑词
export function deleteBlackWord(wordId) {
  return request({
    url: '/system/clean/blackwords/' + wordId,
    method: 'delete'
  })
}

// 重新清洗
export function redoClean(data) {
  return request({
    url: '/system/clean/redo',
    method: 'post',
    data: data
  })
} 